﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace Krilib.Control.Advance
{
    public abstract class TimelineListRenderer
    {
        /// <summary>
        /// Items update
        /// </summary>
        public event EventHandler RedrawRequired;

        /// <summary>
        /// Invoke &quot;RedrawRequired&quot;.
        /// </summary>
        protected void requireRedraw()
        {
            RedrawRequired.Invoke(this, new EventArgs());
        }

        /// <summary>
        /// Timeline list resized
        /// </summary>
        public virtual void Resized() { }

        /// <summary>
        /// Selected item changed
        /// </summary>
        public virtual void SelectedChange() { }

        /// <summary>
        /// Mouse items
        /// </summary>
        public abstract TimelineMouseControllableItem[] Items { get; }

        /// <summary>
        /// Draw normal item
        /// </summary>
        /// <param name="g">graphics</param>
        /// <param name="ypos">y position</param>
        /// <param name="status">target status</param>
        /// <returns>drawing height(if you return -1,Krile will draw default.)</returns>
        public virtual int DrawNormalItem(Graphics g, Data.Status status)
        { return -1; }

        /// <summary>
        /// Draw selected item
        /// </summary>
        /// <param name="g">graphics</param>
        /// <param name="ypos">y position</param>
        /// <param name="status">target status</param>
        /// <returns>drawing height(if you return -1,Krile will draw default.)</returns>
        public virtual int DrawSelectedItem(Graphics g, Data.Status status)
        { return -1; }
    }
}
